/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "pyfntbpersvico")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Pyfntbpersvico.findAll", query = "SELECT p FROM Pyfntbpersvico p"),
    @NamedQuery(name = "Pyfntbpersvico.findByPyfntbpersvicoid", query = "SELECT p FROM Pyfntbpersvico p WHERE p.pyfntbpersvicoid = :pyfntbpersvicoid"),
    @NamedQuery(name = "Pyfntbpersvico.findByReferencia", query = "SELECT p FROM Pyfntbpersvico p WHERE p.referencia = :referencia"),
    @NamedQuery(name = "Pyfntbpersvico.findByFechareferencia", query = "SELECT p FROM Pyfntbpersvico p WHERE p.fechareferencia = :fechareferencia"),
    @NamedQuery(name = "Pyfntbpersvico.findByDescripcion", query = "SELECT p FROM Pyfntbpersvico p WHERE p.descripcion = :descripcion"),
    @NamedQuery(name = "Pyfntbpersvico.findByObservaciones", query = "SELECT p FROM Pyfntbpersvico p WHERE p.observaciones = :observaciones")})
public class Pyfntbpersvico implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "pyfntbpersvicoid")
    private Integer pyfntbpersvicoid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "referencia")
    private String referencia;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fechareferencia")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fechareferencia;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 300)
    @Column(name = "descripcion")
    private String descripcion;
    @Size(max = 255)
    @Column(name = "observaciones")
    private String observaciones;
    @JoinColumn(name = "scittbfadeceid", referencedColumnName = "scittbfadeceid")
    @ManyToOne(optional = false)
    private Scittbfadece scittbfadeceid;
    @JoinColumn(name = "scittbescunid", referencedColumnName = "scittbescunid")
    @ManyToOne
    private Scittbescun scittbescunid;
    @JoinColumn(name = "pyfntbpedidperid", referencedColumnName = "pyfntbpedidperid")
    @ManyToOne(optional = false)
    private Pyfntbpedidper pyfntbpedidperid;

    public Pyfntbpersvico() {
    }

    public Pyfntbpersvico(Integer pyfntbpersvicoid) {
        this.pyfntbpersvicoid = pyfntbpersvicoid;
    }

    public Pyfntbpersvico(Integer pyfntbpersvicoid, String referencia, Date fechareferencia, String descripcion) {
        this.pyfntbpersvicoid = pyfntbpersvicoid;
        this.referencia = referencia;
        this.fechareferencia = fechareferencia;
        this.descripcion = descripcion;
    }

    public Integer getPyfntbpersvicoid() {
        return pyfntbpersvicoid;
    }

    public void setPyfntbpersvicoid(Integer pyfntbpersvicoid) {
        this.pyfntbpersvicoid = pyfntbpersvicoid;
    }

    public String getReferencia() {
        return referencia;
    }

    public void setReferencia(String referencia) {
        this.referencia = referencia;
    }

    public Date getFechareferencia() {
        return fechareferencia;
    }

    public void setFechareferencia(Date fechareferencia) {
        this.fechareferencia = fechareferencia;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public String getObservaciones() {
        return observaciones;
    }

    public void setObservaciones(String observaciones) {
        this.observaciones = observaciones;
    }

    public Scittbfadece getScittbfadeceid() {
        return scittbfadeceid;
    }

    public void setScittbfadeceid(Scittbfadece scittbfadeceid) {
        this.scittbfadeceid = scittbfadeceid;
    }

    public Scittbescun getScittbescunid() {
        return scittbescunid;
    }

    public void setScittbescunid(Scittbescun scittbescunid) {
        this.scittbescunid = scittbescunid;
    }

    public Pyfntbpedidper getPyfntbpedidperid() {
        return pyfntbpedidperid;
    }

    public void setPyfntbpedidperid(Pyfntbpedidper pyfntbpedidperid) {
        this.pyfntbpedidperid = pyfntbpedidperid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (pyfntbpersvicoid != null ? pyfntbpersvicoid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pyfntbpersvico)) {
            return false;
        }
        Pyfntbpersvico other = (Pyfntbpersvico) object;
        if ((this.pyfntbpersvicoid == null && other.pyfntbpersvicoid != null) || (this.pyfntbpersvicoid != null && !this.pyfntbpersvicoid.equals(other.pyfntbpersvicoid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Pyfntbpersvico[ pyfntbpersvicoid=" + pyfntbpersvicoid + " ]";
    }
    
}
